//package com.zhhtech.zhh.ui.fragment
//
//import android.os.Bundle
//import android.view.View
//import com.zhhtech.zhh.common.UserCache
//import com.zhhtech.zhh.common.resetFontSize
//import com.zhhtech.zhh.databinding.FragmentMainLeftBinding
//import com.zhhtech.zhh.ui.activity.commom.AboutActivity
//import com.zhhtech.zhh.ui.activity.commom.AppMessageActivity
//import com.zhhtech.zhh.ui.activity.commom.EnvironmentSwitchActivity
//import com.zhhtech.zhh.ui.activity.commom.FontSettingActivity
//import com.zhhtech.zhh.ui.activity.commom.LoginActivity
//import com.zhhtech.zhh.ui.activity.main.UpdatePasswordActivity
//import com.zhhtech.zhh.ui.base.BaseFragment
//import com.zhhtech.zhh.ui.dialog.showAlertDialog
//import com.zhhtech.zhh.ui.ext.startActivityExt
//import com.zhhtech.zhh.ui.ext.toastMessageLong
//
//
//class MainLeftFragment : BaseFragment<FragmentMainLeftBinding>() {
//    override fun initView(rootView: View?, savedInstanceState: Bundle?) {
//        bindViewClick(vb.buttonLogout, vb.tvDeleteCache, vb.tvFontSetting, vb.tvSysMessage,
//            vb.tvInfo, vb.tvSetting, vb.tvUpdatePassword, vb.ivHead)
//        UserCache.getUserInfoBean().apply {
//            vb.tvNickName.text = "你好，${user.nickName}"
//            vb.tvAccount.text = "账号:${user.userName}"
//        }
//    }
//
//    private var count = 0
//
//    override fun onClick(v: View?) {
//        when (v) {
//            vb.buttonLogout -> {
//                showAlertDialog {
//                    message(message = "确定退出登录吗？")
//                    negativeButton { }
//                    positiveButton {
//                        UserCache.logout()
//                        startActivityExt<LoginActivity>()
//                    }
//                }
//            }
//            vb.tvSysMessage -> startActivityExt<AppMessageActivity> {
//                putExtra("type", "system")
//            }
//            vb.tvUpdatePassword -> startActivityExt<UpdatePasswordActivity>()
//            vb.tvDeleteCache -> "清除成功".toastMessageLong()
//            vb.tvInfo -> startActivityExt<AboutActivity>()
//            vb.tvFontSetting -> launchStartActivityForResult(FontSettingActivity::class.java) {
//                activity?.resetFontSize()
//                activity?.recreate()
//            }
//            vb.tvSetting -> {}
//            vb.ivHead -> {
//                count++
//                if (count >= 5) {
//                    startActivityExt<EnvironmentSwitchActivity> { }
//                    count = 0
//                }
//            }
//        }
//    }
//}